package com.gopay.scheduler.common;

/**
 * Created by liyang on 2017/4/12.
 */
public class BizMerchantSettledConstants {
    /**
     * 商户待入驻
     */
    public static final String TO_SETTLED = "01";

    /**
     * 商户入驻成功
     */
    public static final String SETTLED_SUCCESS = "02";

    /**
     * 商户入驻失败
     */
    public static final String SETTLED_FAIL = "03";

    /**
     * 商户审核中
     */
    public static final String SETTLED_AUDIT = "04";

    /**
     * 微信支付通道
     */
    public static final String WXZF = "WXZF";

    /**
     * 支付宝支付通道
     */
    public static final String ZFBZF = "ZFBZF";

    /**
     * 微信经营类目
     */
    public static final String WX_CATEGORY = "203";

    /**
     * 支付宝经营类目
     */
    public static final String ZFB_CATEGORY = "2015062600009243";
    /**
     * 获取入驻状态转换为文字
     */
    public static String getSettledStat(String code) {
        String settledStat = "";
        if(TO_SETTLED.equals(code)) {
            settledStat = "待入驻";
        } else if(SETTLED_SUCCESS.equals(code)) {
            settledStat = "成功";
        } else if(SETTLED_FAIL.equals(code)) {
            settledStat = "失败";
        } else if(SETTLED_AUDIT.equals(code)) {
            settledStat = "商户审核中";
        }else {
            settledStat = "未知";
        }
        return settledStat;
    }

    /**
     * 通过文字转换为入驻码
     */
    public static String getSettledCode(String settledStat) {
        String code = "";
        if("待入驻".equals(settledStat)) {
            code = TO_SETTLED;
        } else if("成功".equals(settledStat)) {
            code = SETTLED_SUCCESS;
        } else if("失败".equals(settledStat)) {
            code = SETTLED_FAIL;
        } else if("商户审核中".equals(settledStat)) {
            code = SETTLED_AUDIT;
        }
        return code;
    }
}
